import { Component, RegisterComponent } from "@feng3d/ecs";
import { StatsClass } from "../thirdparty/stats.js/imports";

declare module "@feng3d/ecs"
{
    interface ComponentMap { StatsComponent: StatsComponent; }
}

/**
 * 包装`three`中`stats.js`
 */
@RegisterComponent({ name: 'StatsComponent' })
export class StatsComponent extends Component
{
    _stats: StatsClass;

    get dom()
    {
        return this._stats.dom;
    }

    init()
    {
        super.init();

        this._stats = new StatsClass();
    }

    update()
    {
        this._stats.update();
    }

    begin()
    {
        this._stats.begin();
    }

    end()
    {
        this._stats.end();
    }
}
